
<%@ page contentType="text/html;charset=utf-8" %>
<%@ page import="com.ecomm.util.*" %>
<%@ include file="/include/pageexpires.jsp" %>
<%@ include file="/include/currentuserinfo.jsp" %>
<%@ include file="/include/filepath.jsp" %>
<%
String useridtem = Function.normalizeString(request.getParameter("userid"));
String chatListenid = Function.normalizeString(request.getParameter("chatListenid"));

%>

<html>
    <head>
        <title>组织机构列表</title>
        <script language="javascript">
        function check() {
            var subGo = 0;
            var list = "";
            var tmp = "";
            var selname = "";
            var idlisttree = tree.getAllChecked();
            var idlisttrees = idlisttree.split(",");
            
            for (var i = 0; i < idlisttrees.length; i++)
            {
                if (tree.getUserData(idlisttrees[i],'isuser') == 'true')
                {
                    subGo++;
                    list += idlisttrees[i]+",";
                    selname += tree.getItemText(idlisttrees[i])+",";  
                }
            }

            if (subGo < 1)
            {
                alert("请选择用户！");
                return false;
            }
            userform.action="<%=ctxpath%>/chat/ajaxcheck.do?chatListenid=<%=chatListenid%>&userids="+list;
            userform.submit();
            window.opener.document.location.reload();
            window.close();
        }

        </script>
        
        <link type="text/css" rel="stylesheet" href="<%=ctxpath%>/themes/newstyle/styles/office97/office97menu.css" id="menuStyleSheet">
        <link rel="STYLESHEET" type="text/css" href="<%=ctxpath%>/dhtmlxTree/css/dhtmlXTree.css">
        <script  src="<%=ctxpath%>/dhtmlxTree/javascript/dhtmlXCommon.js"></script>
        <script  src="<%=ctxpath%>/dhtmlxTree/javascript/dhtmlXTree.js"></script>
        <script type="text/javascript" src="<%=ctxpath%>/themes/newstyle/javascript/menu3.js"></script>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    </head>
    
    
    <body topmargin="0" leftmargin="0" bgcolor="#ffffff" id="leftbody" bgproperties="fixed" scroll="auto">
        
        <form name="userform" method="post">
            <input type="hidden" name="method" value="updateListenJionName"> 
            <table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0" class="tree" align="center">
                <tr>
                    <td valign="top" nowrap class="tree_td_top"><br><br>
                        <%
                        String id = request.getParameter("id");
                        if(id== null || id.equals("")){
                            id="";
                        }
                        %>
                        <table width="100%" border="0" cellpadding="0" cellspacing="0" class="tree_middle">
                            <tr>
                                <td class="left"><img src="<%=ctxpath%>/themes/newstyle/styles/office97/tree/left_txt.gif"></td>
                                <td valign="top" nowrap class="middle">
                                    <div id="treeboxbox_tree"></div>
                                    <script>
			tree=new dhtmlXTreeObject("treeboxbox_tree","100%","100%","<%=id%>");
			tree.setImagePath("<%=ctxpath%>/dhtmlxTree/imgs/");
			//enable checkboxes
		        tree.enableCheckBoxes(1);
		        //tree.enableRadiobuttons(<%=id%>,true);
		        tree.enableThreeStateCheckboxes(true);
                        // tree.setOnClickHandler(doOnClick);
                        tree.setXMLAutoLoading("<%=ctxpath%>/tree/DhtmlxTree/orgmodle.do?method=getOrgmodleUserXml&userid=<%=useridtem%>");
                        tree.loadXML("<%=ctxpath%>/tree/DhtmlxTree/orgmodle.do?method=getOrgmodleUserXml&id=<%=id%>&userid=<%=useridtem%>");
                                    </script>  
                                </td>
                                <td class="right"></td>
                            </tr>
                        </table>
                    </td>
                </tr>
                <tr>
                    <td valign="bottom" nowrap class="tree_td_bottom" align="center">
                        <input type="button" value="选择" Class="button" onclick="check(this)">
                        <input type="button" value="返回" Class="button" onclick="window.close();"/>
                    </td>
                </tr>
            </table>
            
        </form>
    </body>
</html>
